import sqlite3

def storeLas(data,dbPath):
    conn = sqlite3.connect(dbPath)
    c = conn.cursor()

    c.execute('''CREATE TABLE IF NOT EXISTS las_data (
                        depth REAL,
                        argM REAL,
                        arg1 REAL,
                        arg2 REAL,
                        arg3 REAL,
                        arg4 REAL,
                        arg5 REAL,
                        arg6 REAL,
                        arg7 REAL,
                        arg8 REAL
                    )''')
    conn.commit()

    # 插入数据
    for row in data:
        depth = row[0]
        values = row[1:10]  # 只取前9列
        values = list(values) + [None] * (9 - len(values))  # 确保有9列
        c.execute(
            "INSERT INTO las_data (depth,argM, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)",
            [depth] + values)

    conn.commit()
    conn.close()

